package com.lyz.dataStructure.string;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 17:02
 * @Description:
 **/

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/6/25 17:02
 *@Description:
 **/
// "static void main" must be defined in a public class.
public class Test1 {
    public static void main(String[] args) {
        String s1 = "Hello World";
        // 1. concatenate
        s1 += "!";
        System.out.println(s1);
        // 2. find
        System.out.println("The position of first 'o' is: " + s1.indexOf('o'));
        System.out.println("The position of last 'o' is: " + s1.lastIndexOf('o'));
        System.out.println(s1.substring(6, 11));
    }
}
